package org.example.book.dto;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * 猪头
 */
@Data
public class BookDTO {//id, name, price, stock, author
    private Integer id;
    @NotBlank(message = "图书名称不能为空")
    private String name;
    @NotNull(message = "图书价格不可以为空")
    @Min(value = 0, message = "图书价格不能小于0")
    @Max(value = 300, message = "图书价格不能大于300")
    private Double price;
    @NotNull(message = "图书库存不能为空")
    private Integer stock;
    @NotBlank(message = "图书作者不能为空")
    private String author;
}
